home *** CD-ROM | disk | FTP | other *** search
/ Softwarová Záchrana 3 / Softwarova-zachrana-3.bin / PaperCut Quota / pc-setup.exe / {app} / WebAdmin / TransLog.asp < prev    next >
Text File  |  2004-10-15  |  4KB  |  105 lines

  1. <%@ Language=VBScript %>
  2. <%' (c) Copyright 1999-2004 PaperCut Software Pty. Ltd. %>
  3. <!-- #INCLUDE FILE="includes/PCCommon.inc" -->
  4. <%
  5. Dim intMAX_COUNT
  6. intMAX_COUNT = 100
  7.  
  8. Function TranslateTransBy(s)
  9.     If s = "[net use]" Then
  10.         TranslateTransBy = "[" & GetText("TransByNetUse") & "]"
  11.     ElseIf s = "[printer use]" Then
  12.         TranslateTransBy = "[" & GetText("TransByPrintUse") & "]"
  13.     ElseIf s = "[automatic]" Then
  14.         TranslateTransBy = "[" & GetText("TransByAutomatic") & "]"
  15.     ElseIf Instr(s, "[transfer from") = 1 Then
  16.         TranslateTransBy = "[" & GetTextReplace("TransByTransFrom", Array(Mid(s, 15, Len(s)-15))) & "]"
  17.     ElseIf Instr(s, "[transfer to") = 1 Then
  18.         TranslateTransBy = "[" & GetTextReplace("TransByTransFrom", Array(Mid(s, 13, Len(s)-13))) & "]"
  19.     Else
  20.         TranslateTransBy = s
  21.     End If
  22. End Function
  23.  
  24. %>
  25. <!-- #INCLUDE FILE="includes/header.inc" -->
  26. <%
  27.  
  28. Dim objPCWebAuditLog
  29. Set objPCWebAuditLog        = CreateObject("PCWebAdmin.PCWebAuditLog")
  30. If objPCWebAuditLog.Error Then
  31.     WriteErrorMessage objPCWebAuditLog.ErrorDescription
  32. End If
  33.  
  34. Dim strUserName
  35. strUserName = Trim(Request("strUserName"))
  36.  
  37. If Not gblnIsAdmin or Request("strMyLogs") <> "" Then
  38.     strUserName = gstrLoggedInUser
  39. End If
  40.  
  41. If strUserName <> "" Then
  42.     objPCWebAuditLog.RestrictedOnUser(Trim(strUserName))
  43.     Response.Write "<H1>" & GetTextReplace("RecentTransactionsFor", Array(strUserName)) &  "</H1>"
  44.     WriteUserAdminLinks(strUserName)
  45.     Call DisplayList(False)
  46.     WriteUserAdminLinks(strUserName)
  47. Else
  48.     'objPCWebAuditLog.FullLog ' Defaults to this anyway
  49.     Response.Write "<H1>" & GetText("RecentTransactions") & "</H1>"
  50.     Call DisplayList(True)
  51. End If
  52. Set objPCWebAuditLog = Nothing
  53.  
  54. Sub DisplayList(blnShowUser)
  55.     Response.Write "<CENTER>" & vbCRLF
  56.     Response.Write "<TABLE class=""webAdmin"" width=""95%"" >"    & vbCRLF
  57.     Response.Write "<TR>" & vbCRLF
  58.     Response.Write "<TH>" & GetText("Time") & "</TH>" & vbCRLF
  59.     If blnShowUser Then
  60.         Response.Write "<TH >" & GetText("User") & "</TH>" & vbCRLF
  61.     End If
  62.     Response.Write "<TH>" & GetText("Amount") & "</TH>" & vbCRLF
  63.     Response.Write "<TH>" & GetText("CreditAfterTrans") & "</TH>" & vbCRLF
  64.     Response.Write "<TH>" & GetText("TransactedBy") & "</TH>" & vbCRLF
  65.     Response.Write "<TH>" & GetText("Comment") & "</TH>" & vbCRLF
  66.     Response.Write "</TR>" & vbCRLF
  67.  
  68.  
  69.     objPCWebAuditLog.MoveFirst
  70.     Dim intCount
  71.     intCount = 0
  72.  
  73.     do while ((not objPCWebAuditLog.EOF) and intCount < intMAX_COUNT)
  74.  
  75.         Response.Write "<TR class=""" & RowClassHelper(intCount) & """>"    & vbCRLF
  76.         Response.Write "<TD nowrap align=left>" & objPCWebAuditLog.TransactionTime & "</TD>"  & vbCRLF
  77.  
  78.         If blnShowUser Then
  79.             Response.Write "<TD nowrap align=left><a title=""" & GetTextReplace("ViewUserTrans", Array(objPCWebAuditLog.UserName)) & """ href=""TransLog.asp?strUserName=" & Server.URLEncode(objPCWebAuditLog.UserName) & """>" & objPCWebAuditLog.UserName & "</A></TD>"  & vbCRLF
  80.         End If
  81.  
  82.         If objPCWebAuditLog.TransactionAmount < 0 Then
  83.             Response.Write "<TD align=right class=""creditNeg"">" & objPCWebAuditLog.TransactionAmountText & "</TD>"  & vbCRLF
  84.         Else
  85.             Response.Write "<TD align=right class=""creditPos"">" & objPCWebAuditLog.TransactionAmountText & "</TD>"  & vbCRLF
  86.         End If
  87.  
  88.         Response.Write "<TD align=right>" & objPCWebAuditLog.AmountAfterTransactionText & "</TD>"  & vbCRLF
  89.         Response.Write "<TD align=left>" & TranslateTransBy(objPCWebAuditLog.TransactedBy) & "</TD>"  & vbCRLF
  90.         Response.Write "<TD align=left>" & TranslateTransBy(objPCWebAuditLog.Comment) & "</TD>"  & vbCRLF
  91.  
  92.         Response.Write "</TR>" & vbCRLF
  93.         objPCWebAuditLog.MoveNext
  94.         intCount = intCount + 1
  95.     loop
  96.     Response.Write "</TABLE>" & vbCRLF
  97.     Response.Write "</CENTER>" & vbCRLF
  98.  
  99.  
  100. End Sub
  101.  
  102.  
  103. %>
  104. </CENTER>
  105. <!-- #INCLUDE FILE="includes/footer.inc" -->